package cn.yunhe.service;
import cn.yunhe.dao.INewsDao;
import cn.yunhe.dao.NewsDao;
import cn.yunhe.entity.News;
import net.sf.json.JSONArray;

import java.util.List;

public class NewsService {
    INewsDao newsDao = new NewsDao();

    public JSONArray getNewsJsonArray() {
        JSONArray jsonArray = new JSONArray();
        List<News> newsList = newsDao.getAllNews();
        jsonArray.addAll(newsList);
        return jsonArray;
    }
}